package com.hnu.service;

import java.util.List;

import com.hnu.model.Bookmark;
import com.hnu.model.Userbookmark;
import com.hnu.util.PageInfoBean;

public interface BookmarkServ {
	/**
	 * �����ǩ
	 * @param userId
	 * @param bookmark
	 * @return
	 */
	public boolean addBookmark(long userId,Bookmark bookmark,String indexPath);
	
	/**
	 * �ղ���ǩ
	 * @param bookmarkId
	 * @param userId
	 * @return
	 */
	public boolean collectBookmark(long bookmarkId,long userId);
	
	/**
	 * ����û���ǩ
	 * @param userbookmark
	 * @return
	 */
	public boolean updateUserBookmark(Userbookmark userbookmark);
	
	/**
	 * ɾ���û���ǩ
	 * @param userBookmarkId
	 * @return
	 */
	public boolean deleteUserBookmark(long userBookmarkId);
	
	/**
	 * ��ȡ�ض��û���ǩ
	 * @param userBookmarkId
	 * @return
	 */
	public Userbookmark getUserBookmarkByID(long userBookmarkId);
	
    /**
     * ��ȡ�û���ǩ����
     * @param userId
     * @return
     */
    public int getUserBookmarkCountByUserId(long userId);
    
    /**
     * ��ȡ��ҳ���û���ǩ��Ϣ
     * @param userId
     * @param pageSize
     * @param pageIndex
     * @return
     */
    public PageInfoBean getUserBookmarkByUserId(long userId,int pageSize,int pageIndex);
    
    /**
     * ��¼�û���Ϊ
     * @param bookmarkId
     * @param userId
     * @param choice 1.��ӻ����ղ���ǩ  2.�鿴��ǩ
     * @return ��ǩ��ַ
     */
    public String recordBookmark(long bookmarkId,long userId,int choice);
    
    /**
     * ��ȡ���������Ƶ�count����ǩ
     * @param bookmarkId
     * @param count
     * @return
     */
    public List<Bookmark> getTopNContentSimilar(long bookmarkId,int count,String indexPath);
    
    /**
     * ��ȡ�����û����Ƽ���ǩ
     * @param userID
     * @param howmany
     * @return
     */
    public List<Bookmark> getUserBasedRecommendBookmark(long userID,int howmany);
    
    /**
     * ��ȡ������ǩ���Ƽ���ǩ
     * @param bookmarkID
     * @param howmany
     * @return
     */
    public List<Bookmark> getBookmarkBasedRecommendBookmark(long bookmarkID,int howmany);
    
    /**
     * ��ȡ����������ǩ
     * @param query
     * @param howmany
     * @return
     */
    public List<Bookmark> getSearchBookmark(String query,int howmany,String indexPath);
    
    public String dispatchBookmark(long bookmarkId);
    
    public boolean indexBookmarkBackup(String indexPath);
    
    public boolean isCanModify(long userbookmarkID,long userID);
    
    public List<Bookmark> getTopNBookmark(int count);
    
}
